import wx

class ListPopupMenu(wx.Menu):
    
    def __init__(self, action, style):
        #popup menu
        wx.Menu.__init__(self)
        self.action = action

        if style != 0:
            i = wx.MenuItem(self, -1, "move to Wish list")
            self.AppendItem(i)
            self.Bind(wx.EVT_MENU, self.on_wishlist, i)

        if style != 1:
            i = wx.MenuItem(self, -1, "move to Collect list")
            self.AppendItem(i)
            self.Bind(wx.EVT_MENU, self.on_collectlist, i)
            
        if style != 2:
            i = wx.MenuItem(self, -1, "move to Todo list")
            self.AppendItem(i)
            self.Bind(wx.EVT_MENU, self.on_todolist, i)

        i = wx.MenuItem(self, -1, "delete")
        self.AppendItem(i)
        self.Bind(wx.EVT_MENU, self.on_delete, i)

    def on_todolist(self, evt):
        #print("TODO: move this item to todo list")
        self.action[0] = "TODO"

    def on_wishlist(self, evt):
        #print("TODO: move this item to todo list")
        self.action[0] = "WISH"

    def on_collectlist(self, evt):
        #print("TODO: move this item to todo list")
        self.action[0] = "COLLECT"

    def on_delete(self, evt):
        self.action[0] = "DELETE"

class WishListPopupMenu(ListPopupMenu):
    def __init__(self, action):
        ListPopupMenu.__init__(self, action, 0)

class CollectListPopupMenu(ListPopupMenu):
    def __init__(self, action):
        ListPopupMenu.__init__(self, action, 1)

class TodoListPopupMenu(ListPopupMenu):
    def __init__(self, action):
        ListPopupMenu.__init__(self, action, 2)

        
